<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<base href="<%=basePath%>"/>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link rel="shortcut icon" href="images/icon/${his.favicon}" />
		<title>${his.hospitalName}-用户首页</title>
		<link href="style/css.css" rel="stylesheet" type="text/css" />
		<script src="js/jquery.js"></script>
		<script src="js/date.js" type="text/javascript"></script>
				<script>
			function verfifyEmail(strEmail){
						var CheckMail = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
						 if (!CheckMail.test(strEmail))
						 {
						  return false;
						 }else{
						 return true;
						 }
						}

				function isPasswd(s) { 
					var patrn=/^(\w){6,20}$/; 
					if (!patrn.exec(s)) 
						return false; 
					return true; 
				} 


	        function verifyPhone(phone){  
       // var phone = document.getElementById("phone").value;  
        var tmp = /^1[3-9]\d{9}$/;     //支持11位手机号码验证  
        var flag=tmp.test(phone);  
        if(!flag){   
           return false;  
        }
        return true;  
}

function doCheck(){
var pwd1 = document.example.upass.value;	 // 密码

var pwd2 = document.example.upass2.value;	 // 确认密码
var email = document.example.uemail.value;   // 邮箱
var phone = document.example.uphone.value;   // 电话号码


if(!isPasswd(pwd1)){
	alert("密码只能是6-20个字母、数字、下划线");
	return false; 
}

if (pwd1 != pwd2){
			alert("两次输入的密码不一致，请重新输入！");
			return false;
		}else{
		}

if(!verfifyEmail(email)){
alert("请输入正确的e-mail地址!");
return false;
}else{
}

if (!verifyPhone(phone)){
alert("请输入正确的手机号码！");
 return false;
 }else{
 }
	return true;
}


		</script>
	</head>
	<body>
		<!-- Copyright ?2005. Spidersoft Ltd -->
		<style>
A.applink:hover {
	border: 2px dotted #DCE6F4;
	padding: 2px;
	background-color: #ffff00;
	color: green;
	text-decoration: none
}

A.applink {
	border: 2px dotted #DCE6F4;
	padding: 2px;
	color: #2F5BFF;
	background: transparent;
	text-decoration: none
}

A.info {
	color: #2F5BFF;
	background: transparent;
	text-decoration: none
}

A.info:hover {
	color: green;
	background: transparent;
	text-decoration: underline
}
</style>
		<jsp:include page="users/userTop.jsp"></jsp:include>
		<table width="779" border="0" align="center" cellpadding="0"
			cellspacing="0" style="margin-top: 7px">
			<tr>
				<td width="197" height="500" align="left" valign="top"
					bgcolor="#F6F9FB" class="bgxz_zhong_bk">
					<jsp:include page="users/userLeft.jsp"></jsp:include>
				</td>
				<td width="11" align="left" valign="top">
					&nbsp;
				</td>
				<td width="567" align="left" valign="top" class="bk">
					<table width="567" border="0" cellpadding="0" cellspacing="0"
						style="margin-bottom: 20px">

						<tr>
							<td height="28" align="right" valign="top" bgcolor="#FFFFFF"
								class="ind_zhong_bj">
								<table width="536" border="0" cellspacing="0" cellpadding="0"
									style="margin-top: 4px; margin-right: 10px">
											<c:if test="${message != null}">
									<tr style="background-color: #87CEFF">
										<td align="center" valign="center" height="30">
											<div>${message}</div>
											<%session.removeAttribute("message"); %>
											</td>
											</tr>
											</c:if>
									<tr>
										<td align="left" valign="top">
											<h3>个人信息：</h3>
										</td>
									</tr>
								</table>
							</td>
						</tr>
						<tr>
							<td align="left" valign="top" bgcolor="#FFFFFF">
								<table width="535" border="0" cellspacing="0" cellpadding="0"
									style="margin-top: 22px; margin-left: 16px">
									<tr>
										<td align="left" valign="top">
											<form action="user.do?method=updateInfo" name="example" method="post" enctype="multipart/form-data">
											<input type="hidden" name="uid" value="${userinfo.uid}"/>
								<table width="535" border="0" cellspacing="0" cellpadding="0"
									style="margin-top: 22px; margin-left: 16px">
									<tr>
									
										<td>头像：</td>
										<td><div>
     <p><input type="file" id="txt" name="pic" /></p></div> </td>
									</tr>
									<tr>
									
										<td>用户名：</td>
										<td><input type="text" name="uname" value="${userinfo.uname}" readonly="readonly" size="20"/> </td>
									</tr>
									<tr>
										<td>密码：</td>
										<td><input type="password" name="upass" value="${userinfo.upass}"  size="20"/> </td>
									</tr>
									<tr>
										<td>确认密码：</td>
										<td><input type="password" name="upass2" value="${userinfo.upass}"  size="20"/> </td>
									</tr>
									<tr>
										<td>出生年月：</td>
										<td><input  type="text" name="ubirth" value="${userinfo.ubirth}"
										 readonly="readonly" onfocus="HS_setDate(this)"  size="20"/> </td>
									</tr>
									<tr>
										<td>性别：</td>
										<td>
										<c:choose>
											<c:when test="${userinfo.sex=='男'}">
											<input type="radio" name="sex" value="男" checked/>男 
											<input type="radio" name="sex" value="女" />女
											</c:when>
										<c:otherwise>
											<input type="radio" name="sex" value="男"/>男 
											<input type="radio" name="sex" value="女" checked/>女
										</c:otherwise>
										</c:choose>
										</td>
									</tr>
									<tr>
										<td>Email：</td>
										<td><input type="text" name="uemail" value="${userinfo.uemail}"  size="20"/> </td>
									</tr>
									<tr>
										<td>电话：</td>
										<td><input type="text" name="uphone" value="${userinfo.uphone}"  size="20"/> </td>
									</tr>
									<tr>
										<td colspan="2" align="center"><input type="submit" value="保存" onclick="return doCheck()"/> </td>
									</tr>
								</table>
								</form>
										</td>
									</tr>
								</table>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>

		<table width="779" height="114" border="0" align="center"
			cellpadding="0" cellspacing="0" style="margin-top: 13px">
			<tr>
				<td height="85" align="center" valign="top">
					<table border="0" cellpadding="0" cellspacing="0"
						style="margin-top: 5px">
						<tr>
							<td align="center" valign="middle">
								<jsp:include page="users/yejiao.jsp"></jsp:include>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</body>
</html>
